package com.ruoyi.app.dto;
import com.ruoyi.app.domain.User;
import lombok.Data;
import java.math.BigDecimal;

/*
@description:用户信息
@ClassName UserDto
@author chen
@create 2025-03-13 12:14
@Version 1.0
*/
@Data
//@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserDto
{
    private Long id;
    private String nickName;
    private String name;
    private String avatarUrl;
    private String wxId;
    private String email;
    private String phone;
    private String idNumber;
    private String invitationCode;
    private BigDecimal balance;
    private Boolean isMember;
    private String signature;
    private String password;


    public static UserDto applyList(User item)
    {
        UserDto userDto = new UserDto();
        userDto.setId(item.getId());
        userDto.setPhone(item.getPhone());
        userDto.setName(item.getName());
        userDto.setNickName(item.getNickName());
        userDto.setAvatarUrl(item.getAvatarUrl());
        userDto.setIsMember(item.getIsMember() > 0);
        userDto.setSignature(item.getSignature());
        userDto.setPassword(item.getPassword());
        return userDto;
    }
}
